Skip to content

feat(aarch64): add WHP backend for ARM64 Windows - #1638

Merged
simongdavies merged 2 commits into
hyperlight-dev:mainfrom
cshung:cshung/whp-aarch64
Oct 8, 2026
Merged

simongdavies merged 2 commits into
hyperlight-dev:mainfrom
cshung:cshung/whp-aarch64

Conversation

@cshung

@cshung cshung commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the WHP (Windows Hypervisor Platform) hypervisor backend for aarch64, enabling hyperlight to run micro-VMs on Windows ARM64 systems.

Resolves #1544

Changes

Structural

  • Restructure whp.rs into whp/ directory (mod.rs + x86_64.rs) to support per-architecture implementations, matching the existing kvm/ and mshv/ pattern
  • Fix super::x86_64::hw_interrupts module path after directory restructure

New: whp/aarch64.rs

  • Manual FFI bindings for ARM64 WHP register names, exit reasons, and exit context layout (extracted from Windows SDK WinHvPlatformDefs.h)
  • Full VirtualMachine trait implementation with:
    • MMIO-based I/O handling (ARM64 has no IO ports)
    • Register get/set via WHvGet/SetVirtualProcessorRegisters
    • Surrogate process support (same pattern as x86_64)

Integration

  • Wire WhpVm into hyperlight_vm/aarch64.rs for Windows platform
  • Add WindowsInterruptHandle for aarch64 Windows
  • Add CpuVendor::current() for aarch64 Windows target

Cross-compilation fix

  • Move vmm-sys-util to unix-only dependencies (it doesn't compile on Windows)

Verification

Verified compilation on three targets:

  • x86_64-pc-windows-msvc (native) — just clippy debug/release pass
  • aarch64-pc-windows-msvc (cross-compile) — cargo check passes
  • aarch64-unknown-linux-gnu (cross-compile) — cargo check --features kvm passes

Note: No runtime testing was possible — requires actual ARM64 Windows hardware with Hyper-V enabled. CI has no ARM64 Windows runners.

Why manual FFI bindings?

The windows crate (v0.62) does not expose ARM64 WHP types (register names, exit reasons, exit context structs). All definitions were extracted from the Windows SDK header WinHvPlatformDefs.h (SDK 10.0.26100.0) which has full ARM64 support behind #ifdef _ARM64_.

Copilot AI review requested due to automatic review settings July 12, 2026 15:02
@cshung cshung added kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. ready-for-review PR is ready for (re-)review labels Jul 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Windows Hypervisor Platform (WHP) backend for Windows/aarch64 so Hyperlight can run micro-VMs on ARM64 Windows systems, aligning WHP’s structure with existing per-arch hypervisor layouts.

Changes:

  • Introduces whp/aarch64.rs implementing the VirtualMachine trait for ARM64 WHP, including MMIO-based exit handling and register get/set via WHvGet/SetVirtualProcessorRegisters.
  • Restructures the WHP backend into whp/ with per-architecture modules and fixes x86_64 interrupt helper module paths.
  • Wires WHP into the aarch64 Hyperlight VM path on Windows and moves vmm-sys-util into unix-only dependencies to fix Windows builds.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/hyperlight_host/src/sandbox/snapshot/file/config.rs Adds Windows/aarch64 CPU vendor token for snapshot config.
src/hyperlight_host/src/hypervisor/virtual_machine/whp/x86_64.rs Updates hw_interrupts module paths after WHP directory restructure.
src/hyperlight_host/src/hypervisor/virtual_machine/whp/mod.rs New per-arch WHP module dispatcher (x86_64 vs aarch64).
src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs New ARM64 WHP backend implementation and manual ARM64 WHP FFI bindings.
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs Selects WHP on Windows/aarch64 and adds Windows interrupt handle wiring.
src/hyperlight_host/Cargo.toml Makes vmm-sys-util unix-only to avoid Windows compilation failures.

Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/sandbox/snapshot/file/config.rs Outdated
@cshung
cshung marked this pull request as draft July 13, 2026 02:13
@github-actions github-actions Bot removed the ready-for-review PR is ready for (re-)review label Jul 13, 2026
Comment thread src/hyperlight_host/src/sandbox/snapshot/file/config.rs Outdated
@cshung
cshung force-pushed the cshung/whp-aarch64 branch from 5f992dc to 1d3a299 Compare July 30, 2026 22:14
@jsturtevant jsturtevant mentioned this pull request Aug 5, 2026
2 tasks done
@cshung

cshung commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

End-to-end cargo-hyperlight validation completed on the ARM64 WHP hardware.

Using this PR's 0.16 crates, a freshly scaffolded sample successfully built aarch64-hyperlight-none guests and ran through WHP in debug and release. Host callbacks, typed calls, persistent state, snapshot, and restore passed. I also ran the release workflow 10 times with surrogate mappings and 10 times with surrogates disabled. All runs produced the expected output.

The backend works. The published scaffold is the remaining user-experience gap: cargo-hyperlight pins Hyperlight 0.15 and hardcodes the generated host's x64 guest path. Filed hyperlight-dev/cargo-hyperlight#70 with the reproduction and results.

@syntactically syntactically left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I have a bunch of little nits, and also I (more majorly) think that the addition of reset_vcpu to InteruptHandle seems wrong.

Comment thread src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/x86_64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/mod.rs Outdated
Comment thread src/hyperlight_host/tests/integration_test.rs
Comment thread src/hyperlight_host/tests/integration_test.rs
@cshung
cshung force-pushed the cshung/whp-aarch64 branch 5 times, most recently from 7e93813 to 4c2f4e4 Compare August 18, 2026 23:59
@cshung
cshung force-pushed the cshung/whp-aarch64 branch 3 times, most recently from 404a655 to 189317a Compare August 19, 2026 15:45
@hyperlight-gh-bot

This comment has been minimized.

1 similar comment
@hyperlight-gh-bot

This comment has been minimized.

@cshung
cshung marked this pull request as ready for review September 29, 2026 17:37
@simongdavies

Copy link
Copy Markdown
Member

@cshung the smoke test failed, but is there any reason for no just making this an additional job in the build-test matrix?

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@cshung
cshung force-pushed the cshung/whp-aarch64 branch from 4d08618 to 257930a Compare October 1, 2026 14:54
@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@cshung
cshung force-pushed the cshung/whp-aarch64 branch from 1d092ab to d1f0697 Compare October 1, 2026 22:53
@hyperlight-gh-bot

This comment has been minimized.

@cshung
cshung force-pushed the cshung/whp-aarch64 branch from d1f0697 to 827ea49 Compare October 2, 2026 16:02
@cshung

cshung commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@simongdavies Done. Windows ARM64 now runs as debug and release entries in the standard build-test matrix using the existing ARM64 guest artifacts. Both entries have passed, and the standalone smoke workflow has been removed.

@hyperlight-gh-bot

This comment has been minimized.

@simongdavies simongdavies left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of nits otherwise this looks good

Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
syntactically
syntactically previously approved these changes Oct 7, 2026

@syntactically syntactically left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left some minor nits/suggestions inline.

Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs
Comment thread src/hyperlight_host/tests/sandbox_host_tests.rs Outdated
cshung and others added 2 commits October 7, 2026 14:21
Add native Windows ARM64 support through WHP. Integrate debug and release coverage into the standard build-test matrix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6f20a05d-6bee-4e2e-b320-12f8d9759bbc
Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: 8ee3df4c8c30
Baseline commit: 5ddb37af894e

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 893.33 ns (➖ 1.14x slower)
vec_bytes 584.16 ns (➖ 1.00x faster)
375.73 µs (➖ 1.00x slower)

payload_allocation

slot_pool_segmented
262144 530.62 ns (➖ 1.04x faster)
65536 147.11 ns (➖ 1.01x slower)

sandboxes

create_initialized_and_drop
medium 79.48 ms (➖ 1.00x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
7.78 ns (➖ 1.00x slower) 7.76 ns (➖ 1.00x slower) 7.75 ns (➖ 1.07x faster)

snapshot_files

load_snapshot_unverified
small 89.49 µs (➖ 1.05x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.48 µs (➖ 1.03x slower) 8.27 µs (➖ 1.06x slower)
65536 2.11 µs (➖ 1.01x slower) 1.94 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 6.19 µs (➖ 1.01x slower) 6.66 µs (➖ 1.05x slower)
8192 1.05 µs (➖ 1.02x slower) 1.06 µs (➖ 1.01x faster)
262144 28.91 µs (➖ 1.06x slower)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 682.14 ns (➖ 1.03x faster)
vec_bytes 506.31 ns (➖ 1.03x faster)
660.32 µs (➖ 1.01x slower)

payload_allocation

slot_pool_segmented
262144 501.68 ns (➖ 1.00x slower)
65536 135.84 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 81.33 ms (➖ 1.13x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
7.07 ns (➖ 1.03x slower) 6.96 ns (➖ 1.00x slower) 7.02 ns (➖ 1.01x slower)

snapshot_files

load_snapshot_unverified
small 44.46 µs (➖ 1.00x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.65 µs (➖ 1.02x slower) 7.59 µs (➖ 1.00x faster)
65536 2.14 µs (➖ 1.00x faster) 2.12 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.06 µs (➖ 1.01x slower) 7.12 µs (➖ 1.00x faster)
8192 722.50 ns (➖ 1.00x slower) 722.18 ns (➖ 1.01x faster)
262144 30.29 µs (➖ 1.03x slower)
mshv3 / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 935.44 ns (➖ 1.01x faster)
vec_bytes 709.71 ns (➖ 1.01x faster)
327.62 µs (➖ 1.11x faster)

payload_allocation

slot_pool_segmented
262144 717.78 ns (➖ 1.04x faster)
65536 181.49 ns (➖ 1.07x faster)

sandboxes

create_initialized_and_drop
medium 64.16 ms (➖ 1.12x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.93 ns (➖ 1.02x slower) 9.93 ns (➖ 1.02x slower) 9.96 ns (➖ 1.02x slower)

snapshot_files

load_snapshot_unverified
small 91.33 µs (➖ 1.10x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 8.44 µs (➖ 1.14x faster) 8.78 µs (➖ 1.12x faster)
65536 2.46 µs (➖ 1.02x slower) 2.73 µs (➖ 1.12x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.05 µs (➖ 1.06x faster) 8.04 µs (➖ 1.00x slower)
8192 1.43 µs (➖ 1.10x slower) 1.37 µs (➖ 1.00x slower)
262144 38.82 µs (➖ 1.06x slower)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.03 µs (➖ 1.11x slower)
vec_bytes 666.99 ns (➖ 1.00x slower)
826.73 µs (➖ 1.17x slower)

payload_allocation

slot_pool_segmented
262144 629.05 ns (➖ 1.08x faster)
65536 163.46 ns (➖ 1.04x faster)

sandboxes

create_initialized_and_drop
medium 73.73 ms (➖ 1.15x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.69 ns (➖ 1.01x faster) 8.89 ns (➖ 1.04x slower) 9.03 ns (➖ 1.05x slower)

snapshot_files

load_snapshot_unverified
small 49.47 µs (➖ 1.11x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.78 µs (➖ 1.01x faster) 7.77 µs (➖ 1.00x slower)
65536 2.23 µs (➖ 1.00x faster) 2.28 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.52 µs (➖ 1.00x faster) 7.65 µs (➖ 1.01x slower)
8192 888.80 ns (➖ 1.04x slower) 886.17 ns (➖ 1.00x faster)
262144 40.90 µs (➖ 1.15x slower)
hyperv-ws2025 / amd (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.19 µs (➖ 1.23x slower)
vec_bytes 822.26 ns (➖ 1.17x faster)
2.04 ms (➖ 1.08x faster)

payload_allocation

slot_pool_segmented
262144 781.37 ns (➖ 1.02x faster)
65536 228.62 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 84.10 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
11.88 ns (➖ 1.10x slower) 10.55 ns (➖ 1.04x slower) 10.56 ns (➖ 1.06x slower)

snapshot_files

load_snapshot_unverified
small 735.18 µs (➖ 1.16x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 8.65 µs (➖ 1.09x faster) 8.66 µs (➖ 1.24x faster)
65536 2.54 µs (➖ 1.05x slower) 2.55 µs (➖ 1.07x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 9.29 µs (➖ 1.04x slower) 8.86 µs (➖ 1.02x faster)
8192 1.41 µs (➖ 1.04x slower) 1.38 µs (➖ 1.07x slower)
262144 44.93 µs (➖ 1.13x slower)
hyperv-ws2025 / intel (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.29 µs (➖ 1.06x slower)
vec_bytes 848.70 ns (➖ 1.08x slower)
2.92 ms (➖ 1.08x faster)

payload_allocation

slot_pool_segmented
262144 762.47 ns (➖ 1.35x faster)
65536 211.46 ns (➖ 1.45x faster)

sandboxes

create_initialized_and_drop
medium 108.96 ms (➖ 1.01x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
10.12 ns (➖ 1.23x faster) 10.42 ns (➖ 1.36x faster) 10.01 ns (➖ 1.28x faster)

snapshot_files

load_snapshot_unverified
small 609.70 µs (➖ 1.03x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.77 µs (➖ 1.02x slower) 7.57 µs (➖ 1.06x faster)
65536 2.35 µs (➖ 1.03x slower) 2.29 µs (➖ 1.03x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.49 µs (➖ 1.00x faster) 8.61 µs (➖ 1.01x slower)
8192 1.14 µs (➖ 1.10x faster) 1.20 µs (➖ 1.07x slower)
262144 47.70 µs (➖ 1.15x slower)

Reported by cargo ci bench-report --candidate run:37693529343 --baseline run:37707245718 --config-file bench_report.toml.

@simongdavies
simongdavies merged commit 21604ca into hyperlight-dev:main Oct 8, 2026
213 of 242 checks passed
@cshung
cshung deleted the cshung/whp-aarch64 branch October 8, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support AArch64 on Windows

4 participants